<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>背景位置-混合单位</title>
    <style>
      div {
        width: 300px;
        height: 300px;
        background-color: pink;
        background-image: url(images/logo.png);
        background-repeat: no-repeat;
        /* 如果设置为混合单位：20px center
            x轴一定为20，y一定是center。等价于background-position: 20px
        */
        /* background-position: 20px center; */
        /* 水平是居中对齐，垂直是20px */
        background-position: center 20px;
      }
    </style>
  </head>

  <body>
    <div></div>
  </body>
</html>
